﻿CREATE PROCEDURE [acms].[Post_GetAllWhereRequiresPublishing]
	@SiteId int
AS
	SELECT a.*, b.ParentPath, b.PublishDate as SiteVersion
	FROM [Post_View] a
		inner join [PostPositions] b on a.Id = b.PostId and b.PublishDate is null
	Where SiteId = @SiteId
		and a.PublishFrom is null
		and a.RequiresPublishing = 1
	ORDER By ParentSequence, Sequence
RETURN 0